package test;

import com.rpgfw.graphics.GamePanel;
import com.rpgfw.graphics.PixelImage;
import com.rpgfw.scene.Scene;

import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.io.IOException;

public class Main {

    public static int count=0,repaintcount=0;
    public static void main(String[] args) throws IOException {
        System.out.println("starting...");

        JFrame mwd=new JFrame();
        mwd.setLayout(null);
        mwd.setSize(500,500);
        mwd.setLocation(200,200);
        mwd.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        GamePanel gp=new GamePanel(null,new Dimension(20,20));
        gp.setSize(500,500);
        gp.setLocation(0,0);

        Scene sce=new Scene(22,22);
        sce.setLocation(0,0);

        sce.getPixelGraphics().setColor(Color.blue);
        sce.getPixelGraphics().drawRect(0,0,20,20);
        gp.setScene(sce);

        mwd.add(gp);
        gp.display();
        mwd.setVisible(true);

        //ImageIO.write(pit.getBufferedImage(),"png",new File("D:\\1.png"));
        //mainw.setVisible(true);
    }
}
